import { CellRenderer } from "../../../../fl/controls/listClasses/CellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { SFriendBlessSucess } from "../../../../Message/Public/SFriendBlessSucess";
import { Language } from "../../../../extend/language/Language";
import { EBlessMsgType } from "../../../../Message/Public/EBlessMsgType";
import { FriendBlessMsgConst } from "./FriendBlessMsgConst";
import { GLabel } from "../../../../com/mui/controls/GLabel";
type int = number;
//class BlessListCellRenderer
    
    export  class BlessListCellRenderer extends CellRenderer
    {
        constructor()
        {
            super();
            this.mouseChildren = false;
            this.mouseEnabled = false;
            this.initStyle();
            this.createChildren();
            return;
        }

        /* internal  */initStyle(): void
        {
            this.setStyle("upSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("downSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("overSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("selectedDownSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("selectedOverSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("selectedUpSkin", new Object /* flash.display.Bitmap */());
            return;
        }

        /* internal  */createChildren(): void
        {
            this._sortNum = ObjCreate.createLabel("", 25, 8, 40, 20, flash.text.TextFormatAlign.CENTER, this, false, 11661311);
            this._nameLabel = ObjCreate.createLabel("", 70, 8, 120, 20, flash.text.TextFormatAlign.LEFT, this, false, 11661311);
            this._levelLabel = ObjCreate.createLabel("", 179, 8, 60, 20, flash.text.TextFormatAlign.LEFT, this, false, 11661311);
            this._expLabel = ObjCreate.createLabel("", 250, 8, 70, 20, flash.text.TextFormatAlign.LEFT, this, false, 11661311);
            this._blessLabel = ObjCreate.createLabel("", 315, 8, 160, 20, flash.text.TextFormatAlign.LEFT, this, false, 11661311);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=null;
            super.data = arg1;
            if (arg1) 
            {
                this._sortNum.htmlText = HTMLUtil.addColor(arg1["ordinal"] + "", "#B1efff");
                loc1 = arg1["bless"] as SFriendBlessSucess;
                this._nameLabel.htmlText = HTMLUtil.addColor(loc1.fromPlayerName, "#B1efff");
                this._levelLabel.htmlText = HTMLUtil.addColor(loc1.blessLevel + Language.getString(69410), "#B1efff");
                this._expLabel.htmlText = HTMLUtil.addColor(loc1.blessRewardExp + "", "#B1efff");
                this._blessLabel.htmlText = HTMLUtil.addColor(this.getMsgByType(loc1.blessMsgType), "#B1efff");
            }
            return;
        }

        /* internal  */getMsgByType(arg1: int): string
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case EBlessMsgType._EBlessMsgTypeOne:
                {
                    return FriendBlessMsgConst.FriendBlessMsg_1;
                }
                case EBlessMsgType._EBlessMsgTypeTwo:
                {
                    return FriendBlessMsgConst.FriendBlessMsg_2;
                }
                case EBlessMsgType._EBlessMsgTypeThree:
                {
                    return FriendBlessMsgConst.FriendBlessMsg_3;
                }
                default:
                {
                    return "";
                }
            }
        }

        /* internal */ /* var */_sortNum: GLabel;

        /* internal */ /* var */_nameLabel: GLabel;

        /* internal */ /* var */_levelLabel: GLabel;

        /* internal */ /* var */_expLabel: GLabel;

        /* internal */ /* var */_blessLabel: GLabel;
    }
